#include<bits/stdc++.h>
#define y1 Y1
#define fi first
#define endl "\n"
#define se second
#define PI acos(-1)
#define int long long
#define pb(x) push_back(x)
#define PII pair<int, int>
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 2e5 + 10;
int a[N];
int n, cnt;
int f[N];
int prime[N];
unordered_map<int, int>mp;

void is_prime(int n) {
	for(int i = 2; i <= n; ++ i ) {
		if(f[i] == false) {
			prime[++cnt] = i;
			mp[i]++;
		//	cout << "i = " << i << endl;
		}
		for(int j = 1; prime[j] <= n / i; ++ j ) {
			f[i * prime[j]] = 1;
			if(i % prime[j] == 0)break;
		}
	}
}

signed main() {
	IOS;
	cin >> n;
	is_prime(n + 1);
	if(n > 2)
	cout << 2 << endl;
	else cout << 1 << endl; 
	_for(i, 1 + 1, n + 1) {
		if(mp[i])cout << 1 << ' ';
		else cout << 2 << ' ';
	}
	cout << endl;
	return 0;
}

/*
2

1 
1 1
*/

